var express = require('express');
var router = express.Router();


var db = require('../model/index')

/* GET users listing. */
router.get('/', (req, res, next) => {
  let mysql = `SELECT * FROM data_list`
  db(mysql,[],(err,data)=> {
    console.log(req.query);
    if (err) {
      return res.json({
        state:500,
        message: '数据库操作失败，请稍后重试',
      })
    }

    res.json({
      state: 200,
      message:'数据库操作成功',
      data:data
    })
  })
});

module.exports = router;